package com.example.yuejian.yuejian.bean;

import com.google.gson.Gson;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Administrator on 2017/9/25.
 */

public class MasterClass {


    /**
     * id : 1
     * classname : 射箭
     * photo : http://10.0.2.2/laravel54/public/Uploads/2017-09-06-05-47-15-59af8be300e96.jpg
     * num : 123
     * mid : 1
     */

    private int id;
    private String classname;
    private String photo;
    private int num;
    private int mid;

    public static MasterClass objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), MasterClass.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setClassname(String classname) {
        this.classname = classname;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public void setMid(int mid) {
        this.mid = mid;
    }

    public int getId() {
        return id;
    }

    public String getClassname() {
        return classname;
    }

    public String getPhoto() {
        return photo;
    }

    public int getNum() {
        return num;
    }

    public int getMid() {
        return mid;
    }
}
